﻿using BlogSystem.Data.Entity;
using BlogSystem.Model.Request;
using BlogSystem.Model.Respones;

namespace BlogSystem.Service;

public interface IArticleService
{
  
    /// <summary>
    /// 分页查询
    /// </summary>
    /// <param name="keyWord">关键词</param>
    /// <param name="pageIndex">页码</param>
    /// <param name="pageSize">每页大小</param>
    /// <returns></returns>
    Task<IQueryable<ArticleResponse>> GetArticlesAsync(string keyWord,int pageIndex,int pageSize);

   /// <summary>
   /// 添加+修改
   /// </summary>
   /// <param name="getArticleRequest">请求携带参数体</param>
   /// <returns></returns>
   Task<bool>  AddArticle(GetArticleRequest getArticleRequest);

   Task<bool> UpdateArticle(int id,GetArticleRequest articleRequest);
   
   /// <summary>
   /// 逻辑删除
   /// </summary>
   /// <param name="id">文章id</param>
   /// <returns></returns>
   Task<bool> DelArticleById(int id);
    
   /// <summary>
   ///  根据id获取到当前文章
   /// </summary>
   /// <param name="id">文章id</param>
   /// <returns></returns>
   // Task<Article> GetById(int id);
   Task<Article> GetById(int id);
   
   
   /// <summary>
   /// 点赞+1
   /// </summary>
   /// <param name="id">当前文章的id</param>
   /// <returns></returns>
   Task<bool> AddLikeById(int id);
   
   /// <summary>
   /// 收藏+1
   /// </summary>
   /// <param name="id">当前文章的id</param>
   /// <returns></returns>
   Task<bool> AddSaveById(int id);
  
   /// <summary>
   /// 阅读人数 +1
   /// </summary>
   /// <param name="id">当前文章的id</param>
   /// <returns></returns>
   Task<bool> AddReadById(int id);
}